<!-- 
  @Created by   on 2019-6-18 14:56:52.
  @updated by
  @description 额度信息
-->
<div>
  <yu-xform related-table-name="refTable" form-type="search">
    <yu-xform-group :column="4">
      <yu-xform-item :placeholder="$t('limitInfo.edbh')" name="limitNo" ctype="input"></yu-xform-item>
      <yu-xform-item :placeholder="$t('limitInfo.zjhm')" name="certCode" ctype="input"></yu-xform-item>
    </yu-xform-group>
  </yu-xform>
  <div class="yu-toolBar">
    <yu-button-group>
      <yu-button icon="plus" @click="addFn">{{ $t('limitInfo.xz') }}</yu-button> 
      <yu-button icon="edit" @click="modifyFn">{{ $t('limitInfo.xg') }}</yu-button> 
      <yu-button icon="document" @click="infoFn">{{ $t('limitInfo.xq') }}</yu-button>
      <yu-button icon="yx-bin" @click="deleteFn">{{ $t('limitInfo.sc') }}</yu-button>
    </yu-button-group>
  </div>
  <yu-xtable ref="refTable" row-number :data-url="dataUrl">
    <yu-xtable-column :label="$t('limitInfo.edbh')" prop="limitNo" width="120"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.xm')" prop="cusName" width="120"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.zjhm')" prop="certCode" width="120"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.zjlx')" prop="certType" width="120" :options="certType"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.ysxed')" prop="preCreditLimit" width="100"  :formatter="formatterPreCreditLimit"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.sjsxed')" prop="actualLimit" width="100"  :formatter="formatterActualLimit"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.yyed')" prop="usedLimit" width="100"  :formatter="formatterUsedLimit"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.sjyyed')" prop="actualUsedLimit" width="100"  :formatter="formatterActualUsedLimit"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.edlx')" prop="limitType" width="120" :options="limitType"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.edzt')" prop="limitStatus" width="120" :options="limitStatus"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.edqxy')" prop="limitTermsMonth" width="100"></yu-xtable-column>
    <yu-xtable-column :label="$t('limitInfo.edkssj')" prop="limitStartDate"></yu-xtable-column>
  </yu-xtable>
  <!-- 说明dialog可配置宽高属性，若不配置则宽度默认为屏幕50%，高度自适应
      width="650px" height="380px" -->
  <yu-xdialog :title="viewTitle[viewType]" :visible.sync="dialogVisible" width="750px">
    <yu-xform ref="refForm" label-width="120px" v-model="formdata" :disabled="formDisabled">
      <yu-xform-group>
        <yu-xform-item :label="$t('limitInfo.edbh')" :hidden="true" name="limitNo" ctype="input"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.xm')" name="cusName" rules="required" ctype="input" :disabled="cusef"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.zjhm')" name="certCode" rules="required" ctype="input" :disabled="cusef"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.zjlx')" name="certType" rules="required" ctype="select" :options="certType" :disabled="cusef" ></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.ysxed')" name="preCreditLimit" ctype="num" :digit="2" :formatter="formatter" ></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.sjsxed')" name="actualLimit" ctype="num" :disabled="itemDisabled" :digit="2" :formatter="formatter" :hidden="itemHidden"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.yyed')" name="usedLimit" ctype="num" :disabled="itemDisabled" :digit="2" :formatter="formatter" :hidden="itemHidden"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.sjyyed')" name="actualUsedLimit" ctype="num" :disabled="itemDisabled" :digit="2" :formatter="formatter" :hidden="itemHidden"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.edlx')" name="limitType" ctype="select" :options="limitType"  ></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.edzt')" name="limitStatus" ctype="select" :options="limitStatus" :filter-method="addLimitStatusFilter"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.edqxy')" name="limitTermsMonth" ctype="num" rules="required"></yu-xform-item>
        <yu-xform-item :label="$t('limitInfo.edkssj')" name="limitStartDate" ctype="datepicker" rules="required"></yu-xform-item>
      </yu-xform-group>
      <div class="yu-grpButton">
        <yu-button v-show="saveBtnShow" icon="check" type="primary" @click="saveFn">{{ $t('limitInfo.bc') }}</yu-button>
        <yu-button icon="yx-undo2" @click="cancelFn">{{ $t('limitInfo.qx') }}</yu-button>
      </div>
    </yu-xform>
  </yu-xdialog>
</div>
